package com.shopManager.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.shopManager.Interceptor.SessionCheckInterceptor;

@Configuration
public class WebMvcConfigurer  extends WebMvcConfigurerAdapter{
    //增加拦截器
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(new SessionCheckInterceptor())    //指定拦截器类
                .addPathPatterns("/**/*.shtml");        //指定该类拦截的url
    }
}